<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well" data-original-title>
            <h2>
                <i class="icon-edit"></i>Vào bill
            </h2>

        </div>

        <script type="text/javascript">
            function changecateajax(selectObj) {
                var id = selectObj.value;
                var dataString = id;
                $.ajax({
                    url: "<?php echo base_url() . 'welcome/show_cate_ajax/'; ?>" + dataString,
                    type: 'POST',
                    data: dataString,
                    success: function(output_string) {
                        $(".resultset").html(output_string);
                    }
                });
            }
        </script>
        <?php echo form_open_multipart('welcome/add_order'); ?>
        <div class="box-content">
            Ngày tạo: <?php echo date('d-m-Y');?><br/>
            Tạo bàn: <font color="red"><?php echo $this->session->userdata('username'); ?>
            </font> <br/>
            <font color="red"><?php if (isset($notification)) ; echo $notification; ?>
            </font>
            <div class="control-group">
                <label class="control-label" for="typeahead"><b>Tên bàn:</b> </label>
                <div class="controls">
                    <select name="name_items"> 
                        <?php foreach ($tables as $table): ?>
                            <option value="<?php echo $table->id; ?>" <?php
                            if ($table->id == $table_id) {
                                echo 'selected="selected"';
                            }
                            ?>>
                                        <?php echo $table->table_name ?>
                            </option>
                        <?php endforeach; ?>
                        <select>

                            </div>
                            </div>
                            <div>
                                <label class="control-label" for="typeahead">Loại:</label>
                                <div>
                                    <select name="category_select" onchange="changecateajax(this);">
                                        <option value="0" selected="selected">------------</option>
                                        <?php foreach ($listcate as $cate): ?>
                                            <option value="<?php echo $cate->id; ?>">
                                                <?php echo $cate->catename; ?>
                                            </option>
                                        <?php endforeach; ?>
                                        <p class="help-block"></p>
                                    </select>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="typeahead">Chọn món:</label>
                                <div class="controls">
                                    <div class="resultset"></div>
                                    <input type="number" name="item_amount" id="item_amount" /> 
                                     <br/>
                                    <INPUT type="button" name="AddMoreFileBox" id="AddMoreFileBox" value="Thêm món" onclick="addRow('dataTable')" />
 
    
                                    <p class="help-block"></p>
                                </div>
                            </div>

                            <fieldset>



                                <div class="control-group">
                                    <label class="control-label" for="typeahead"><b>Đã chọn:</b> </label>
                                    <div class="controls">
                                        <TABLE id="dataTable" width="350px" border="1">
                                        <TR>
                                            <TD><INPUT type="button" value="Xóa" onclick="deleteRow('dataTable')" /></TD>
                                            <TD> Số lượng </TD>
                                            <TD> Tên món </TD> 
                                        </TR>
                                    </TABLE>
                                        <div id="InputsWrapper"></div>

                                        <p class="help-block"></p>
                                    </div>
                                </div>


                                <div class="form-actions">
                                    <button type="submit" name="submit" class="btn btn-primary">Lưu</button>

                                </div>
                            </fieldset>


                            </div>
                            <?php echo form_close(); ?>
                            </div>
                            <!--/span-->

                            </div>
                            <!--/row-->
